using MySqlConnector;

namespace Front._1118;

public partial class Login : Form
{
    public Login()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        using var connection = new MySqlConnection("server=localhost;port=3306;database=book;user=root;password=123456;charset=utf8mb4;AllowPublicKeyRetrieval=True;");
        connection.Open();

        string sql = "SELECT * FROM admin_info where admin_account=@username and admin_password=@password";
        
        using var command = new MySqlCommand(sql, connection);
        using var reader = command.ExecuteReader();
        while (reader.Read())
            Console.WriteLine(reader.GetInt32(0));

        
    }


    private void Login_Click(object sender, EventArgs e)
    {
        throw new NotImplementedException();
    }
}
